"""
Project Name : api_automation_framework
File Name : stream-bytes-n.py
Author : lldhsds
Date : 2024/12/28 20:57
Description: /stream/{n}, 流式传输 n 个 JSON 响应
"""

import requests

def stream_n(n: int) -> None:
    """
    /stream/{n}, Streams n JSON responses.
    :param n: int
    :responses 200 Streamed JSON responses.
    """
    url = f"http://httpbin.org/stream/{n}"
    headers = {'Accept': 'application/json'}
    response = requests.get(url, headers=headers)
    print(response.status_code)
    print(response.text)
    print(response.content)
    print(response.headers)

stream_n(10)
